package cn.nbt.busManage.model.dto;

import cn.nbt.busManage.model.entity.Route;
import cn.nbt.busManage.model.vo.RouteVo;
import jakarta.persistence.Column;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * {@code @Author} lyq
 * {@code @Date} 6/13/2024 7:04 PM
 */

@Data
public class RouteDto {
    private Integer id;
    private String routeName;
    private Integer startPointId;
    private Integer endPointId;
    private String points;
    private String times;
//    起始站-终点站
    private String startToEndPoint;
//    站点列表
    private List<PointDto> pointDtos;
//    站点1-站点2 时间xxx
    private List<Map<List<PointDto>,String>> pointsTime;
    //    总时间
    private Integer sumTime;

    public RouteDto(RouteVo routeVo){
        this.id = routeVo.getId();
        this.routeName = routeVo.getRouteName();
        this.startPointId = routeVo.getStartPointId();
        this.endPointId = routeVo.getEndPointId();
        this.points = routeVo.getPoints();
        this.times = routeVo.getTimes();
    }
    public RouteDto(Route route){
        this.id = route.getId();
        this.routeName = route.getRouteName();
        this.startPointId = route.getStartPointId();
        this.endPointId = route.getEndPointId();
        this.points = route.getPoints();
        this.times = route.getTimes();
    }
}
